﻿<Window x:Class="WithRefsTest.Client.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Client="clr-namespace:WithRefsTest.Client"
        Title="MainWindow"
        Width="525"
        Height="350"
        DataContext="{Binding Source={StaticResource vm}}">
	<Window.Resources>
		<Client:NumericConverter x:Key="NumericConverter" />
	</Window.Resources>
	<Grid Margin="20">
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="Auto" />
			<ColumnDefinition Width="0.25*" />
			<ColumnDefinition />
		</Grid.ColumnDefinitions>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition />
		</Grid.RowDefinitions>

		<TextBlock Grid.Row="0"
		           Grid.Column="0"
		           Margin="4,0"
		           VerticalAlignment="Center"
		           Text="Entity ID: " />
		<TextBox x:Name="EntityIdTextBox"
		         Grid.Row="0"
		         Grid.Column="1"
		         VerticalAlignment="Center"
		         Text="{Binding Id,
		                        Mode=TwoWay,
		                        UpdateSourceTrigger=PropertyChanged,
		                        Converter={StaticResource NumericConverter}}"
		         TextAlignment="Center" />
		<Button Grid.Row="0"
		        Grid.Column="2"
		        Margin="4"
		        HorizontalAlignment="Left"
		        Command="{Binding GetEntity1Command}"
		        CommandParameter="{Binding Id,
		                                   Mode=OneWay,
		                                   UpdateSourceTrigger=PropertyChanged}"
		        Content="Get Entity1"
		        Padding="4" />

		<TextBlock Grid.Row="1"
		           Grid.Column="0"
		           Margin="4,0"
		           VerticalAlignment="Center"
		           FontWeight="Bold"
		           Text="Entity ID (Result): " />
		<TextBox Grid.Row="1"
		         Grid.Column="1"
		         VerticalAlignment="Center"
		         FontWeight="Bold"
		         IsReadOnly="True"
		         Text="{Binding Result.Id}"
		         TextAlignment="Center" />
	</Grid>
</Window>
